<template>
	<view class="container">
		<image class="schoolBadge" :src="getOnlineImage('/image/schoolBadge.png')"></image>
		<view class="row">
			<uni-row >
				<uni-col :offset="1" :span="3" ><image class="icon" :src="getOnlineImage('/image/account.png')"></image></uni-col>
				<uni-col :span="19" ><input placeholder="请输入学工号" type="number" @input="inputID"/></uni-col>
			</uni-row>
			<view class="seperation"></view>
		</view>
		<view class="row1">
			<uni-row >
				<uni-col :offset="1" :span="3" ><image class="icon" :src="getOnlineImage('/image/pwd.png')"></image></uni-col>
				<uni-col :span="19" ><input placeholder="请输入密码" type="safe-password" confirm-type="go" @input="inputPwd"/></uni-col>
			</uni-row>
			<view class="seperation"></view>
		</view>
		<button class="submit-button" @click="bindAccount">关联账号</button>sss
	</view>
</template>
s
<script>
	export default {
		data() {
			return {
				schoolID:"",
				password:""
			}
		},
		computed:{
			getOnlineImage: function() {
			  return function(path) {
				return this.$ProjectConfig.STATIC_BASE_URL + path;
			  };
			}
		},
		methods: {
			inputID: function(event) {
				this.schoolID = event.target.value
			},
			inputPwd: function(event) {
				this.password = event.target.value
			},
			bindAccount(){
				const that=this;
				var url = this.$ProjectConfcig.API_BASE_URL + '/user/bindAccount';
				  //发起网络请求
				  wx.request({
					url: url,
					data: {
					  openid: uni.getStorageSync("auth_token"),
					  schoolID: that.schoolID
					},
					method: 'POST',
					success(res) {
					  console.log("绑定成功");
					},
					fail(err) {
					  console.log("失败");
					}
				  });
				
			}
			
		}
	}
</script>

<style lang="scss">
.container{
	display: flex;
	flex-direction: column;
	align-items: center;
	padding:30rpx 10rpx;
}
.schoolBadge{
	margin:20rpx;
	width:350rpx;
	height:350rpx;
}
.row{
	margin:100rpx 0rpx 40rpx 0rpx;
	width:95%;
	font-size: $uni-font-size-base;
}
.row1{
	margin:20rpx 0rpx 40rpx 0rpx;
	width:95%;
	font-size: $uni-font-size-base;
}
.icon{
	width:40rpx;
	height:40rpx;
	margin:5rpx;
}
.seperation{
	background-color: #CCC;
	width:100%;
	height:1rpx;
	margin:4rpx 0rpx 10rpx 0rpx;
}
.submit-button{
	margin:10rpx;
	background-color: $uni-bg-color;
	width:80%;
	color: #FFF;
	font-size: $uni-font-size-base;
	padding:5rpx;
}
</style>
